<template>
<div class="main-layout">
  <!-- 渲染头部（命名视图：header） -->
  <router-view name="header"></router-view>
  <!-- 渲染嵌套子路由（主内容） -->

</div>
</template>

<script setup lang="ts">
import { onMounted } from 'vue';
import { useRoute } from 'vue-router';

const route = useRoute();
onMounted(() => {
  console.log('当前路由路径:', route.path);
  console.log('当前路由名称:', route.name);
});
</script>

<style scoped>
.main-layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  margin-left: 60px;
  background-color: #f9f9f9;
}
</style>